/**
 *  Copyright Matt Silbernagel 2010
 *  
 *	This file is part of MobilePrinting.
 *
 *	MobilePrinting is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  MobilePrinting is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with MobilePrinting.  If not, see <http://www.gnu.org/licenses/>.
 */


package edu.uc.labs.MobilePrinting.OSUtils;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;

import org.apache.log4j.Logger;
import org.w3c.dom.Document;

import edu.uc.labs.MobilePrinting.Configurator;

public class Writer {
	
	protected static Logger logger = Configurator.LOGGER;

	public Writer() throws ParserConfigurationException{
		
		try {
			tFactory = TransformerFactory.newInstance();
			transformer = tFactory.newTransformer();
		} catch (Exception e) {
			logger.debug(e.toString());
		}

		transformer.setOutputProperty("encoding", "UTF-8");
		DocumentBuilder builder;	
		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		builder = factory.newDocumentBuilder();
		doc = builder.newDocument();

		doc.setXmlStandalone(true);
	}

	protected Document doc;
	protected TransformerFactory tFactory = null;
	protected Transformer transformer = null;

}
